package com.zmn.plat.common.dictionary;

/**
 * 合同-部门编码枚举
 *
 * @author linfeng
 * @since 2020/05/14 14:56:30
 */
public enum ContractDeptEnum {

    /**
     * values
     */
    XTGLB(4000, "系统管理部", "XT"),
    DDZX(1010, "订单中心", "DD"),
    YXZX(1009, "营销中心", "YX"),
    YFZX(1008, "研发中心", "YF"),
    XXZX(1007, "线下中心", "XX"),
    XSZX(1006, "线上中心", "XS"),
    GG(1005, "高管", "GG"),
    SQQDB(1004, "社区渠道部", "SQ"),
    GLZX(1003, "管理中心", "GL"),
    CGB(1002, "采供部", "CG"),
    CWB(1001, "财务部", "CW"),
    QTZX(0, "其他中心", "QT")
    ;

    private Integer code;
    private String name;
    private String abbreviation;

    ContractDeptEnum(Integer code, String name, String abbreviation) {
        this.code = code;
        this.name = name;
        this.abbreviation = abbreviation;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public String getAbbreviation() {
        return abbreviation;
    }

    public static ContractDeptEnum of(Integer code) {
        if (code == null || code == 0) {
            return QTZX;
        }
        switch (code) {
            case 4000:
                return XTGLB;
            case 1010:
                return DDZX;
            case 1009:
                return YXZX;
            case 1008:
                return YFZX;
            case 1007:
                return XXZX;
            case 1006:
                return XSZX;
            case 1005:
                return GG;
            case 1004:
                return SQQDB;
            case 1003:
                return GLZX;
            case 1002:
                return CGB;
            case 1001:
                return CWB;
            default:
                return QTZX;
        }
    }
}
